home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / tls / tls074c.sunsparc.Z / tls074c.sunsparc / lib / vtcl / examples / frame.tcl < prev    next >
Encoding:
Text File  |  1995-07-20  |  2.5 KB  |  99 lines

  1. #!/bin/vtcl
  2. # ---------------------------------------------------------------------
  3. # Copyright 1994 by SCO, Inc.
  4. # Permission to use, copy, modify, distribute, and sell this software
  5. # and its documentation for any purpose is hereby granted without fee,
  6. # provided that the above copyright notice appear in all copies and that
  7. # both that copyright  notice  and  this  permission  notice  appear  in
  8. # supporting documentation, and that the name  of  SCO  not  be used  in
  9. # advertising or publicity pertaining  to distribution of  the  software
  10. # without   specific,   written  prior   permission.    SCO   makes   no
  11. # representations  about  the  suitability  of  this  software  for  any
  12. # purpose.  It is provided "as is" without express or implied warranty.
  13. # ---------------------------------------------------------------------
  14.  
  15. # Demo        : frame.tcl
  16. # Description    : Demo of features of the Frame widget, including shadow
  17. #          types.
  18. #  
  19. # Note        : Frame widget in Character Motif only displays a solid
  20. #          border.  Also, there is no Title support.
  21.  
  22. # Close connection and exit Vtcl interpreter.
  23. proc CloseCB { cbs } {
  24.     VtClose; exit 0
  25. }
  26.  
  27. proc ChangeFrameCB {frame type cbs} {
  28.     if { [VtInfo -charm] == 1 } {
  29.         set mainF [keylget cbs dialog]
  30.         VtShow [VtInformationDialog $mainF.Info \
  31.             -message "In Charm Mode... \n1. A Frame simply puts a box around a widget.\n2. Title is not supported." \
  32.             -ok \
  33.             ]
  34.     }
  35.     VtSetValues $frame \
  36.         -shadowType $type \
  37.         -title $type
  38. }
  39.  
  40. proc noTitleCB {frame cbs} {
  41.     VtSetValues $frame \
  42.         -title NONE
  43. }
  44.  
  45. #
  46. # Start Program
  47. #
  48. set ap [VtOpen frame]
  49.  
  50. set mainForm [VtFormDialog $ap.form \
  51.     -title "VtFrame" \
  52.     ]
  53.  
  54. set frame [VtFrame $mainForm.frame \
  55.     -title "ETCHED_IN" \
  56.     -topSide FORM \
  57.     -leftSide FORM \
  58.     -bottomSide FORM \
  59.     ]
  60.                  
  61. # This puts a row column inside the frame to give
  62. # it some width.
  63. set frameRowCol [VtRowColumn $frame.frameRowCol]
  64.  
  65. # Need to put something in the rowcolumn widget.
  66. VtLabel $frameRowCol.lab1 -label "                        " 
  67.  
  68. set buttonRowCol [VtRowColumn $mainForm.buttonRowCol \
  69.     -leftSide NONE \
  70.     -rightSide FORM \
  71.     -topSide FORM\
  72.     ]
  73.  
  74. foreach type {IN OUT ETCHED_IN ETCHED_OUT} {
  75.     VtPushButton $buttonRowCol.$type \
  76.         -label $type \
  77.         -labelCenter \
  78.         -callback "ChangeFrameCB $frame $type" 
  79. }
  80.  
  81. VtPushButton $buttonRowCol.none \
  82.     -label "No Title" \
  83.     -labelCenter \
  84.     -callback "noTitleCB $frame"
  85.  
  86. VtPushButton $buttonRowCol.quit \
  87.     -label QUIT \
  88.     -labelCenter \
  89.     -callback CloseCB
  90.  
  91. VtSetValues $frame \
  92.     -rightSide $buttonRowCol \
  93.     -rightOffset 30 
  94.  
  95. VtShow $mainForm
  96.     
  97. VtMainLoop
  98.  
  99.